﻿namespace DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddYqzs : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.yqzs",
                c => new
                    {
                        YqzsId = c.Guid(nullable: false),
                        BodyTemperature = c.Single(nullable: false),
                        Symptom = c.String(maxLength: 50),
                        HasTouched = c.Boolean(nullable: false),
                        StayWorking = c.Boolean(nullable: false),
                        SurveyResult = c.String(maxLength: 200),
                        Remark = c.String(maxLength: 2000),
                    })
                .PrimaryKey(t => t.YqzsId)
                .ForeignKey("dbo.employee", t => t.YqzsId, cascadeDelete: true)
                .Index(t => t.YqzsId);
            
            CreateTable(
                "dbo.track",
                c => new
                    {
                        TrackId = c.Guid(nullable: false),
                        DepartureTime = c.DateTime(nullable: false),
                        DeparturePlace = c.String(maxLength: 100),
                        ArrivingTime = c.DateTime(nullable: false),
                        ArrivingPlace = c.String(maxLength: 100),
                        Trasportation = c.String(maxLength: 50),
                        TrackCode = c.String(maxLength: 50),
                        YqzsId = c.Guid(nullable: false),
                    })
                .PrimaryKey(t => t.TrackId)
                .ForeignKey("dbo.yqzs", t => t.YqzsId, cascadeDelete: true)
                .Index(t => t.YqzsId);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.track", "YqzsId", "dbo.yqzs");
            DropForeignKey("dbo.yqzs", "YqzsId", "dbo.employee");
            DropIndex("dbo.track", new[] { "YqzsId" });
            DropIndex("dbo.yqzs", new[] { "YqzsId" });
            DropTable("dbo.track");
            DropTable("dbo.yqzs");
        }
    }
}
